package cn.itsource.org.domain;

import cn.hutool.core.lang.RegexPool;
import cn.itsource.basic.domain.BaseDomain;
import cn.itsource.basic.domain.BaseTreeNode;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
//@table 就是将表名与实体类名称做关系映射
@Table(name = "t_employee")
public class Employee implements BaseDomain{
    //    alt + 鼠标左键
    //这个@id 是为了标识该字段对应数据库的主键id
    @Id
    private Long id;
    @NotBlank(message = "用户名不能为空")
    private String username;
    @Email(message = "请输入正确的邮箱")
    private String email;
    @Pattern(regexp = RegexPool.MOBILE,message = "请输入正确的手机号")
    @NotBlank(message = "手机号不能为空")
    private String phone;
    private String password;
    private Integer age;
    private Integer state;
    private Long departmentId;

    private Department department;
    private Long logininfoId;

    private Shop shop;
    private Long shopId;
    private Boolean shopAdmin;
    private Boolean del;
    private String salt;


}
